
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<title>油站结算信息确认</title>
		<meta http-equiv="Content-type" content="textml; charset=utf-8" />
		<meta content="telephone=no" name="format-detection" />
		<meta name="x5-orientation" content="portrait">
		<meta name="screen-orientation" content="portrait">
		<meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=yes">
		<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
		<meta http-equiv="X-UA-Compatible" content="ie=edge">
		<link rel="stylesheet" type="text/css" href="//img.ejiayou.com/activity/images/groupon/ejyCommonCss.css">
		<link rel="stylesheet" type="text/css" href="//img.ejiayou.com/activity/pages/platform/grap_ticket/css/reset.css"/>
		<link rel="stylesheet" type="text/css" href="css/index.css"/>
		<link rel="stylesheet" type="text/css" href="css/app_station_detail.css"/>
		<style type="text/css">
			html{
				width: 100%;
				overflow-x: hidden;
			}
			#codeNum {
				position: absolute;
				top: -100%;
				/* font-size: 0; */
			}
			.goToInfo{
				width: 100%;
				font-size: 0.44rem;
				font-weight: 400;
				color: #3397FF;
				line-height: 1.56rem;
				text-align: center;
			}
		</style>
		<script type="text/javascript">
			eval(function(p, a, c, k, e, r) {
				e = function(c) {
					return c.toString(a)
				};
				if(!''.replace(/^/, String)) {
					while(c--) r[e(c)] = k[c] || e(c);
					k = [function(e) {
						return r[e]
					}];
					e = function() {
						return '\\w+'
					};
					c = 1
				};
				while(c--)
					if(k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]);
				return p
			}('(6(a,d){j b=a.i,e="3"f 5?"3":"9",c=6(){b.7.8=(2>b.4?b.4:2)/2*g+"h"};a.0&&(d.0(e,c,!1),a.0("k",c,!1))})(l,5);', 22, 22, 'addEventListener||750|orientationchange|clientWidth|window|function|style|fontSize|resize||||||in|64|px|documentElement|var|DOMContentLoaded|document'.split('|'), 0, {}))
		</script>
	</head>
	<body>
		<div id="app" v-clock>
			<input id="codeNum" readonly="readonly" value="">
			<div class="load_end" v-if="!loadEnd"></div>
			<div class="header">
				<div class="header_item">
					<div class="header_item_fl">工单名称：</div>
					<div class="header_item_rg">{{work_order.title}}</div>
				</div>
				<div class="header_item">
					<div class="header_item_fl">工单号：</div>
					<div class="header_item_rg">{{work_order.id}}</div>
				</div>
				<div class="header_state">
					<span class="header_state_1" v-if="work_order.handle_state == 1">
						流转中
					</span>
					<span class="header_state_2" v-if="work_order.handle_state == 0">
						待提交
					</span>
					<span class="header_state_3" v-if="work_order.handle_state != 0 && work_order.handle_state!=1">
						已结束
					</span>
				</div>
			</div>
			<div class="main">
				<van-field readonly clickable :value="work_order_content.stationName" input-align="right" label="油站名" class='main_info' readonly></van-field>
				<van-field readonly clickable label="上线时间" :value="work_order_content.onLineTime" input-align="right"  class='main_info'></van-field>
				<div class="goToInfo" @click="goToPage()">查看油站结算信息 &gt;</div>
				<div class="look" v-if="work_order.handle_state == 0"></div>
				
				<div class="" style="min-height: 5.2rem;">
					<div class="workflow" v-if="workflows.length>0">
						<div class="workflow_title">审批工作流</div>
						<div class="workflow_item"  v-for="(item,index) in workflows">
							<div class="workflow_item_fl_fl">
								<div class='yuan'></div>
								<div class='line' v-if="index+1!=workflows.length"></div>
							</div>
							<div class="workflow_item_con">
								<div class="workflow_item_content">
									<div class="workflow_item_fl">
										
										<div class="workflow_item_fl_rg">
											<div class="submit">
												<div class="submit_top">
													<div class="submit_title">{{item.node_name}}</div>
													<div class="isfinish"  v-if="work_order.handle_state != 4&&item.order_node_state == 1">
														
														<span>已处理</span>
														
													</div>
													
													<div class="issubmit"  v-if="work_order.handle_state != 4&&item.order_node_state == 0">
														<span v-if="index==0">未提交</span>
														<span v-if="index!=0">待审核</span>
														
													</div>
												</div>
												<div class="submit_bottom" v-if="index==0"><span>{{item.user_name || ''}}</span></div>
												<div class="submit_bottom" v-if="index==1"><span> {{((item.admin_id==0)&&(item.work_order_node_id==36||item.work_order_node_id==38))?'财务':item.user_name}}</span></div>
											</div>
												
										</div>
									</div>
									<div class="workflow_item_rg">
										<div class="submit_time" v-if="item.update_time">
											{{item.update_time}}
										</div>
									</div>
								</div>
								<div class="comments" v-if="item.remark">审批意见：{{item.remark}}</div>
							</div>
						</div>
						
					</div>
				</div>
			</div>
			<!--<div v-if="is_operator">
				<div class="next" @click="comeToApproval">确认</div>	
			</div>-->
			<div v-if="is_create == 1 && work_order.handle_state == 3">
				<div class="next" @click="comeToSet">修改</div>	
			</div>
			<div class="revoke" @click="rebackUrl" v-if="!is_operator">返回</div>
			
		</div>
		<script src="https://img.ejiayou.com/activity/pages/freeOrders/js/vue.js"></script>
    	<script src="https://img.ejiayou.com/activity/pages/freeOrders/js/jquery-1.9.1.min.js"></script>
<!--	<script src="https://res.wx.qq.com/open/js/jweixin-1.4.0.js" type="text/javascript"></script>-->
		<script src="https://cdn.jsdelivr.net/npm/vue@2.6/dist/vue.min.js"></script>
		<script src="https://cdn.jsdelivr.net/npm/vant@2.11/lib/vant.min.js"></script>
		<script src="//img.ejiayou.com/activity/images/groupon/common.js"></script>
		<script type="text/javascript" src="//img.ejiayou.com/activity/images/pay_lottery/clipboard.min.js"></script>
		<!-- <script src="https://cdn.bootcss.com/vConsole/3.3.4/vconsole.min.js"></script> -->
		<script>
			var clipboard
			var admin_id = getQueryVariable('admin_id') || ''
			var work_order_id = getQueryVariable('work_order_id')||''
			var vm = new Vue({
				el: '#app',
				data: {
					loadEnd: false,
					stationName:'油站名字',
					programme:'方案1',//方案
					subsidyTime:'2020-01-01 00:00:00',//补贴时间
					subsidyDay:'35天',//补贴天数
					show: false,
					stationValue:'',
					message:'设置 type 为 range 后可以选择日期区间，此时 confirm 事件返回的 date 为数组结构，数组第一项为开始时间，第二项为结束时间。',
					overlayShow:false,
					mytext:'',
					workflows: [],
					admin_id: admin_id,
					work_order_id: work_order_id,
					work_order: '',
					work_order_content: '',
					is_create: 0,
					is_operator: 0,
					role_id: 0,
					showPopUp: false
            	},	
				created: function() {
					var that = this
					// var vConsole = new VConsole()
				},
				mounted: function() {
					this.getFormData()
				},
				// 监听输入框值变化
				methods: {
					getFormData: function(fn) {
						var self = this
						var data = {
							user_id: this.admin_id || '',
							work_order_id: this.work_order_id
							
						}
						$.ajax({
							url: '/eapi/v1/activity/work/approval_flow?t='+new Date().getTime(),
							data: data,
							
							type: 'post',
							 dataType: 'json',
							success: function(res) {
								console.log(res)
								if(res.status == 200) {
									var resData = res.data
									self.work_order = resData.work_order
									self.work_order_content = JSON.parse(resData.work_order.content)
									self.is_create = resData.is_create
									self.role_id = resData.role_id
									self.is_operator = resData.is_operator
									self.workflows = resData.flow
									self.loadEnd = true
									if(fn) {
										fn()
									}
								}
							}
						})
					},
					rebackUrl: function() {
						history.back()
					},
					submitApproval: function(status, fn) {
						var self = this
						var data = {
							work_order_id: this.work_order_id,
							admin_id: this.admin_id,
							audit: status
						}
						$.ajax({
							url: '/eapi/v1/activity/work/exchange_node',
							data: data,
							type: 'post',
							dataType: 'json',
							success: function(res) {
								console.log(res)
								if(res.status == 200) {
									var resData = res.data
									if(fn) {
										fn()
									}
								}
							},
							error: function(err) {
								
							}
						})
					},
					
					comeToApproval: function() {
						var self = this
						self.submitApproval(1, function() {
							
							self.getFormData()	
						})
						
					},
					comeToSet:function(){
						location.href = 'settle_info_set.html?admin_id='+this.admin_id+'&work_order_id='+this.work_order_id
					},
					goToPage:function(){
						location.href = 'settle_info.html?admin_id='+this.admin_id+'&work_order_id='+this.work_order_id
					}
			    }  
			})
		</script>
	</body>

</html>
